package com.qianyu.project.mapper.provider;

import org.apache.ibatis.jdbc.SQL;
import org.springframework.util.ObjectUtils;

import java.util.Map;

/**
 * @Author ww
 * @desc
 */
public class BuildProgressPlanProvider {

    public String Tlist(Map<String,String> params){
        return new SQL(){
            {
          SELECT("p_id,main_task,sub_task,start_date,end_date");
          FROM("build_progress_plan b,project_info p ");
          WHERE("b.p_id=p.id");
          if(!ObjectUtils.isEmpty(params.get("main_task"))){
               WHERE("main_task like '%"+params.get("main_task")+"%'");
          }
          if(!ObjectUtils.isEmpty(params.get("sub_task"))){
                WHERE("sub_task like '%"+params.get("sub_task")+"%'");
            }

            }
        }.toString();
    }
}
